pattern questions in coding